import Vue from "vue";
import VueRouter from "vue-router";
import Index from "../views/Index.vue";
import BookDesc from "../views/BookDesc.vue"
import ShowCar from "../views/ShowCar.vue"
import Login from "../views/Login.vue"
import Register from "../views/Register.vue"
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "index",
    component: Index,
  },//配置图书详情页的路由
  {
    // path: "/bookDesc/:book_id",//:book_id等同一个占位符
    path: "/bookDesc",
    name: "bookDesc",
    component: BookDesc,
  },
  {
    path: "/showCar",
    name: "showCar",
    component: ShowCar,
  },
  {
    path: "/login",
    name: "login",
    component: Login,
  },
  {
    path: "/register",
    name: "register",
    component: Register,
  },

];

const router = new VueRouter({
  routes,
});

export default router;
